package com.zhongjinkang.rhythm.Model

import com.huang.mylibrary.db.DBHelper
import com.zhongjinkang.rhythm.uiBean.PortrayBean

class PeopleDetailModel :BaseModel() {


    fun getList(peopleId: Long,name: String): List<PortrayBean> {
        val data = DBHelper.getInstance().imageListInfoHelper.getListByPeopleId(peopleId)
        val returnData = mutableListOf<PortrayBean>()
        for (index in 0 until data.size) {
            returnData.add(
                createPortrayBean(
                    data[index].url,
                    name,
                    data[index].peopleId
                )
            )
        }
        return returnData;
    }

    fun createPortrayBean(url: String, name: String, peopleId: Long): PortrayBean {
        val portrayBean = PortrayBean()
        portrayBean.url = url
        portrayBean.describe = name;
        portrayBean.peopleId = peopleId
        return portrayBean

    }
}